<template>
    <lay-container fluid="true" style="padding: 10px">
        <lay-row :space="10">
            <lay-col :md="24">

                    <lay-tree :data="treeData" collapse-transition @node-click="handleClick" class="layui-tree-txtss">
                    </lay-tree>

            </lay-col>
        </lay-row>
    </lay-container>
</template>
    
<script lang="ts" >
import { ref, watch ,defineComponent} from "vue";
import { getCateTree } from "../../api/module/content/category";
import { useRouter } from "vue-router";
export default defineComponent({
    name: "WebSiteCate",
})
</script>

<script lang="ts" setup>
const treeData = ref([])
const router = useRouter();
const GetList = function () {
    getCateTree().then((res) => {
        if (res.status == 1) {
            treeData.value = res.data
        }
    })
}

function handleClick(node: any) {
    router.push({ path: '/content/content', query: { Cid: node.id } })
}

GetList()

</script>
<style scoped>
    .layui-tree-line .layui-tree-entry:hover .layui-tree-txt{color: #fff !important;}
    .layui-tree-txtss{color: #fff !important;}
</style>